//	Company:	HTHK
//	NAME:	    Project.java
//	TITLE:	    The maintence of Project in Time Sheet System
//	FUNCTION:	The class Project associate with the table
//	BY:	        Kodak Xu
//	DATE:	    09/12/2003
//	Update_by	Poly Li
//	Update_date	16-01-2004
//	Update_by	Beyes Xia
//	Update_date	2004-2-13 17:42
//	Update_comments	alter table
// --------------------------------------------------------------
// MODIFICATION HISTORY
// --------------------------------------------------------------
//	CR Log #:  99999  BY:  XXXX   DATE:  dd/mm/yyyy
//	ERROR:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//	FIX:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// --------------------------------------------------------------
package tss.project;

import com.ffpc.sql.*;

import tss.project.ProjectBean;

public class Project
   extends DataObject
   implements ProjectBean
{
   private String project_name = null;
   private String project_category_name = null;
   private String comments = null;
   private String create_date = null;
   private String create_by = null;
   private String upd_date = null;
   private String upd_by = null;
   private String effective_range_from = null;
   private String effective_range_to = null;
   private String chargeable_ind = null;
   private String project_group_name = null;
   private Column ColProjectName = null;
   private Column ColProjectCategoryName = null;
   private Column ColComments = null;
   private Column ColCreateDate = null;
   private Column ColCreateBy = null;
   private Column ColUpdDate = null;
   private Column ColUpdBy = null;
   private Column ColEffectiveRangeFrom = null;
   private Column ColEffectiveRangeTo = null;
   private Column ColChargeableInd = null;
   private Column ColProjectGroupName = null;
   /**
    * Constructor
    */
   public Project()
   {
       ColProjectName = new Column(0,"project_name",Column.Types.string,null,20,false);
       ColProjectCategoryName = new Column(1,"project_category_name",Column.Types.string,null,20,false);
       ColComments = new Column(2,"comments",Column.Types.string,null,255,true);
       ColCreateDate = new Column(3,"create_date",Column.Types.time,null,7,false);
       ColCreateBy = new Column(4,"create_by",Column.Types.string,null,10,false);
       ColUpdDate = new Column(5,"upd_date",Column.Types.time,null,7,true);
       ColUpdBy = new Column(6,"upd_by",Column.Types.string,null,10,true);  // modify by Frankh 2009-04-02
       ColEffectiveRangeFrom = new Column(7,"effective_range_from",Column.Types.string,null,7,true);
       ColEffectiveRangeTo = new Column(8,"effective_range_to",Column.Types.string,null,7,true);
       ColChargeableInd = new Column(9,"chargeable_ind",Column.Types.string,null,1,false);
       ColProjectGroupName = new Column(10,"project_group_name",Column.Types.string,null,20,false);
   }

   // functions belongs to ProjectBean interface

   @Override
public void setProject_name(String project_name)
   {       this.project_name = this.setAttribute(ColProjectName,project_name);
   }

   @Override
public String getProject_name()
   {       return this.project_name==null?"":this.project_name;
   }

   @Override
public void setProject_category_name(String project_category_name)
   {       this.project_category_name = this.setAttribute(ColProjectCategoryName,project_category_name);
   }

   @Override
public String getProject_category_name()
   {       return this.project_category_name==null?"":this.project_category_name;
   }

   @Override
public void setComments(String comments)
   {       this.comments = this.setAttribute(ColComments,comments);
   }

   @Override
public String getComments()
   {       return this.comments==null?"":this.comments;
   }

   @Override
public void setCreate_date(String create_date)
   {       this.create_date = this.setAttribute(ColCreateDate,create_date);
   }

   @Override
public String getCreate_date()
   {       return this.create_date==null?"":this.create_date;
   }

   @Override
public void setCreate_by(String create_by)
   {       this.create_by = this.setAttribute(ColCreateBy,create_by);
   }

   @Override
public String getCreate_by()
   {       return this.create_by==null?"":this.create_by;
   }

   @Override
public void setUpd_date(String upd_date)
   {       this.upd_date = this.setAttribute(ColUpdDate,upd_date);
   }

   @Override
public String getUpd_date()
   {       return this.upd_date==null?"":this.upd_date;
   }

   @Override
public void setUpd_by(String upd_by)
   {       this.upd_by = this.setAttribute(ColUpdBy,upd_by);
   }

   @Override
public String getUpd_by()
   {       return this.upd_by==null?"":this.upd_by;
   }

@Override
public void setEffective_range_from(String effective_range_from)
   {       this.effective_range_from = this.setAttribute(ColEffectiveRangeFrom,effective_range_from);
   }

   @Override
public String getEffective_range_from()
   {       return this.effective_range_from==null?"":this.effective_range_from;
   }

   @Override
public void setEffective_range_to(String effective_range_to)
   {       this.effective_range_to = this.setAttribute(ColEffectiveRangeTo,effective_range_to);
   }

   @Override
public String getEffective_range_to()
   {       return this.effective_range_to==null?"":this.effective_range_to;
   }

   @Override
public void setChargeable_ind(String chargeable_ind)
   {       this.chargeable_ind = this.setAttribute(ColChargeableInd,chargeable_ind);
   }

	@Override
	public String getChargeable_ind()
	{       return this.chargeable_ind==null?"":this.chargeable_ind;
	}

   @Override
public void setProject_group_name(String project_group_name)
   {       this.project_group_name = this.setAttribute(ColProjectGroupName,project_group_name);
   }

   @Override
public String getProject_group_name()
   {       return this.project_group_name==null?"":this.project_group_name;
   }


   // belongs to row interface

   @Override
public Column[] createColumns()
   {
       Column[] cols = new Column[11];
       cols[0] = ColProjectName.clone(null);
       cols[1] = ColProjectCategoryName.clone(null);
       cols[2] = ColComments.clone(null);
       cols[3] = ColCreateDate.clone(null);
       cols[4] = ColCreateBy.clone(null);
       cols[5] = ColUpdDate.clone(null);
       cols[6] = ColUpdBy.clone(null);
       cols[7] = ColEffectiveRangeFrom.clone(null);
       cols[8] = ColEffectiveRangeTo.clone(null);
       cols[9] = ColChargeableInd.clone(null);
       cols[10] = ColProjectGroupName.clone(null);
       return cols;
   }

   // super's abstract methods

   @Override
public String getTableName()
   {
       return "tss.tss_c_project";
   }

   @Override
protected String[] getKeyColumnNames()
   {
       String[] list = {
                         "project_name"
                       };
       return list;
   }

   @Override
protected String[] getUpdatableColumnNames()
   {
       String[] list = {
                         "project_category_name"
                         ,"comments"
                         ,"create_date"
                         ,"create_by"
                         ,"upd_date"
                         ,"upd_by"
                         ,"effective_range_from"
                         ,"effective_range_to"
                         ,"chargeable_ind"
                         ,"project_group_name"
                       };
       return list;
   }

   @Override
protected void retrieveColumnValues()
   {
       this.project_name = this.retrieveColumnValue("project_name");
       this.project_category_name = this.retrieveColumnValue("project_category_name");
       this.comments = this.retrieveColumnValue("comments");
       this.create_date = this.retrieveColumnValue("create_date");
       this.create_by = this.retrieveColumnValue("create_by");
       this.upd_date = this.retrieveColumnValue("upd_date");
       this.upd_by = this.retrieveColumnValue("upd_by");
       this.effective_range_from = this.retrieveColumnValue("effective_range_from");
       this.effective_range_to = this.retrieveColumnValue("effective_range_to");
       this.chargeable_ind = this.retrieveColumnValue("chargeable_ind");
       this.project_group_name = this.retrieveColumnValue("project_group_name");
   }
}

